package org.spring.aicloud.mapper;

import org.apache.ibatis.annotations.Update;
import org.spring.aicloud.entity.Discuss;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lei
 * @since 2024-07-10
 */
public interface DiscussMapper extends BaseMapper<Discuss> {

    @Update("update discuss set readcount=readcount+1 where did=#{did}")
    int updateReadCount(@RequestParam("did") Long did);


    @Update("update discuss set supportcount=supportcount+1 where did=#{did}")
    int updateSupportCount(@RequestParam("did") Long did);

}
